home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 April / CHIP CD (4 - 2007).iso / beeld / 3d / ArtOfIllusion24-Mac.dmg / Art of Illusion / ArtOfIllusion.jar / bsh / commands / cd.bsh < prev    next >
Text File  |  2005-05-23  |  388b  |  20 lines

  1. /**
  2.     Change working directory for dir(), etc. commands (like Unix cd)
  3. */
  4.  
  5. bsh.help.cd = "usage: cd( path )";
  6.  
  7. /*
  8.     Additions by Kevin Raulerson, http://www.spin.com.mx/~kevinr/
  9. */
  10. void cd( String pathname ) 
  11. {
  12.     this.file = pathToFile( pathname );
  13.  
  14.     if ( file.exists() && file.isDirectory() )
  15.         bsh.cwd = file.getCanonicalPath();
  16.     else
  17.         print( "No such directory: "+pathname);
  18. }
  19.  
  20.